import request from '@/config/axios'

// 配置信息 VO
export interface ConfigurationVO {
  id: number // 编号
  name: string // 名称
  configKey: string // 配置key
  configValue: string // 值
  remark: string // 备注
}

// 配置信息 API
export const ConfigurationApi = {
  // 查询配置信息分页
  getConfigurationPage: async (params: any) => {
    return await request.get({ url: `/agent/configuration/page`, params })
  },

  // 查询配置信息详情
  getConfiguration: async (id: number) => {
    return await request.get({ url: `/agent/configuration/get?id=` + id })
  },

  // 新增配置信息
  createConfiguration: async (data: ConfigurationVO) => {
    return await request.post({ url: `/agent/configuration/create`, data })
  },

  // 修改配置信息
  updateConfiguration: async (data: ConfigurationVO) => {
    return await request.put({ url: `/agent/configuration/update`, data })
  },

  // 删除配置信息
  deleteConfiguration: async (id: number) => {
    return await request.delete({ url: `/agent/configuration/delete?id=` + id })
  },

  // 导出配置信息 Excel
  exportConfiguration: async (params) => {
    return await request.download({ url: `/agent/configuration/export-excel`, params })
  },
}